This repository was archived by the owner on May 26, 2026. It is now read-only.
[DmfsTask] implement time field handlers#437
Merged
Merged
Conversation
b99d8a1 to
e25d272
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors dmfs task time-related field mapping by extracting timestamp → iCalendar temporal conversion into a dedicated utility and introducing dedicated field handlers, with Robolectric tests validating expected conversions.
Changes:
- Added
TaskTimeFieldto convert dmfs task timestamps (+ TZ/all-day) into the appropriateTemporalfor iCalendar properties. - Introduced
StartTimeHandler,DueHandler, andDurationHandlerand wired them intoDmfsTaskProcessor. - Added Robolectric unit tests for DTSTART, DUE, and DURATION handling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt | Replaces inline DTSTART/DUE/DURATION mapping with new field handlers. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/TaskTimeField.kt | New utility for converting dmfs task timestamps into LocalDate/Instant/ZonedDateTime. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/StartTimeHandler.kt | New handler that maps Tasks.DTSTART into Task.dtStart. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/DueHandler.kt | New handler that maps Tasks.DUE into Task.due. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/DurationHandler.kt | New handler that maps Tasks.DURATION into Task.duration. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/StartTimeHandlerTest.kt | Tests DTSTART mapping for all-day, TZ-based, and UTC-instant cases. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/DueHandlerTest.kt | Tests DUE mapping for all-day, TZ-based, and UTC-instant cases. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/DurationHandlerTest.kt | Tests DURATION parsing/mapping for representative values. |
e25d272 to
4b3cfd9
Compare
rfc2822
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.